package com.example.mvplibrary.mvplibrary.ui.fragment;

import com.example.mvplibrary.mvplibrary.model.BaseModel;
import com.example.mvplibrary.mvplibrary.presenter.BasePresenter;
import com.example.mvplibrary.mvplibrary.view.BaseView;

public abstract class BaseMvpFragment <V extends BaseView,M extends BaseModel,P extends BasePresenter<V,M>> extends BaseFragment {
    public P presenter;

    @Override
    protected void initData() {
        presenter=createPresenter();
        if(presenter!=null){
            presenter.bindView((V) this);
        }
        initEvent();
    }

    protected abstract P createPresenter();

    protected abstract void initEvent();
}
